package javaTest.Singleton;

//懒汉式单例类.在第一次调用的时候实例化
public class Singleton2 {
	private Singleton2() {
	}

	private static Singleton2 sing2 = null;

	public synchronized static Singleton2 getInstance() {
		if (sing2 == null) {
			sing2 = new Singleton2();
		}
		return sing2;
	}
}
